package felix.dataviewer.Base;

import android.content.Context;

/**
 * Created by huangmf on 8/16/2017.
 */

public class PresenterFactory {
    public static <V extends BaseViewI, P extends BasePresenter<V>> P createPresenter(Class<? extends P> type, Context context, V viewI) {
        try {
            Object obj = type.newInstance();
            P p = (P) obj;
            p.init(context, viewI);
            return p;
        } catch (IllegalAccessException var5) {
            var5.printStackTrace();
        } catch (InstantiationException var6) {
            var6.printStackTrace();
        }
        return null;
    }
}
